<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>document2html: src/libs/curlwrapper/curlwrapper.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">document2html
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Documents to HTML converter</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('curlwrapper_8hpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">curlwrapper.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="curlwrapper_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacecurlwrapper.html">curlwrapper</a> {</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    std::string <a class="code" href="namespacecurlwrapper.html#a1162bb7be8fe09a965a7a1bb0cdfbf39">getRandomProxy</a>(<span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; proxyList);</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="namespacecurlwrapper.html#a50f3677ad83d7880032bddbf3bc27539">curlCallbackFunc</a>(<span class="keywordtype">void</span>* contents, <span class="keywordtype">size_t</span> size, <span class="keywordtype">size_t</span> nmemb, std::string* s);</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    std::string <a class="code" href="namespacecurlwrapper.html#aa6ecf5b2f117ccd38e9373d963c08774">getPageContent</a>(<span class="keywordtype">int</span>&amp; code, <span class="keyword">const</span> std::string&amp; link, <span class="keywordtype">long</span> timeout = 20,</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                               <span class="keywordtype">int</span> attemptCount = 1, <span class="keywordtype">int</span> interval = 0,</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                               <span class="keyword">const</span> std::string&amp; userAgent = <span class="stringliteral">&quot;&quot;</span>,</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;                               <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; headerList = {},</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;                               <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; cookieList = {},</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;                               <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; proxyList = {});</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="namespacecurlwrapper.html#ab9be8a703f474d8851f71d6c5116ff05">downloadFile</a>(<span class="keyword">const</span> std::string&amp; link, <span class="keyword">const</span> std::string&amp; path, <span class="keywordtype">long</span> timeout = 20,</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                      <span class="keywordtype">int</span> attemptCount = 1, <span class="keywordtype">int</span> interval = 0, <span class="keyword">const</span> std::string&amp; userAgent = <span class="stringliteral">&quot;&quot;</span>,</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                      <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; headerList = {},</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;                      <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; cookieList = {},</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;                      <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; proxyList = {});</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="namespacecurlwrapper.html#adfdbecb51cd70de090d5f1945d18d44d">  112</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="namespacecurlwrapper.html#adfdbecb51cd70de090d5f1945d18d44d">STATUS_OK</a> = 0;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;}  <span class="comment">// End namespace</span></div><div class="ttc" id="namespacecurlwrapper_html_aa6ecf5b2f117ccd38e9373d963c08774"><div class="ttname"><a href="namespacecurlwrapper.html#aa6ecf5b2f117ccd38e9373d963c08774">curlwrapper::getPageContent</a></div><div class="ttdeci">std::string getPageContent(int &amp;code, const std::string &amp;link, long timeout, int attemptCount, int interval, const std::string &amp;userAgent, const std::vector&lt; std::string &gt; &amp;headerList, const std::vector&lt; std::string &gt; &amp;cookieList, const std::vector&lt; std::string &gt; &amp;proxyList)</div><div class="ttdoc">Get site content. </div><div class="ttdef"><b>Definition:</b> curlwrapper.cpp:50</div></div>
<div class="ttc" id="namespacecurlwrapper_html_a1162bb7be8fe09a965a7a1bb0cdfbf39"><div class="ttname"><a href="namespacecurlwrapper.html#a1162bb7be8fe09a965a7a1bb0cdfbf39">curlwrapper::getRandomProxy</a></div><div class="ttdeci">std::string getRandomProxy(const std::vector&lt; std::string &gt; &amp;proxyList)</div><div class="ttdoc">Get random proxy. </div><div class="ttdef"><b>Definition:</b> curlwrapper.cpp:28</div></div>
<div class="ttc" id="namespacecurlwrapper_html_ab9be8a703f474d8851f71d6c5116ff05"><div class="ttname"><a href="namespacecurlwrapper.html#ab9be8a703f474d8851f71d6c5116ff05">curlwrapper::downloadFile</a></div><div class="ttdeci">void downloadFile(const std::string &amp;link, const std::string &amp;path, long timeout, int attemptCount, int interval, const std::string &amp;userAgent, const std::vector&lt; std::string &gt; &amp;headerList, const std::vector&lt; std::string &gt; &amp;cookieList, const std::vector&lt; std::string &gt; &amp;proxyList)</div><div class="ttdoc">Download and save file. </div><div class="ttdef"><b>Definition:</b> curlwrapper.cpp:99</div></div>
<div class="ttc" id="namespacecurlwrapper_html"><div class="ttname"><a href="namespacecurlwrapper.html">curlwrapper</a></div><div class="ttdoc">Wrapper for cURL library. </div></div>
<div class="ttc" id="namespacecurlwrapper_html_a50f3677ad83d7880032bddbf3bc27539"><div class="ttname"><a href="namespacecurlwrapper.html#a50f3677ad83d7880032bddbf3bc27539">curlwrapper::curlCallbackFunc</a></div><div class="ttdeci">size_t curlCallbackFunc(void *contents, size_t size, size_t chunk, std::string *str)</div><div class="ttdoc">cURL callback function which allows save site content to std::string </div><div class="ttdef"><b>Definition:</b> curlwrapper.cpp:36</div></div>
<div class="ttc" id="namespacecurlwrapper_html_adfdbecb51cd70de090d5f1945d18d44d"><div class="ttname"><a href="namespacecurlwrapper.html#adfdbecb51cd70de090d5f1945d18d44d">curlwrapper::STATUS_OK</a></div><div class="ttdeci">const char STATUS_OK</div><div class="ttdef"><b>Definition:</b> curlwrapper.hpp:112</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_87a455bccb09a92130c26a11a880c98a.html">libs</a></li><li class="navelem"><a class="el" href="dir_ec7c55f329a59c1a8ed86894bf350ddf.html">curlwrapper</a></li><li class="navelem"><a class="el" href="curlwrapper_8hpp.html">curlwrapper.hpp</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
